"ui";

let a  = 2
let b = `<button id="ok" text="确定2" />`
setTimeout(()=>{ui.run(()=>{
    ui.layout(
        `<vertical padding="16">
          <text textSize="16sp" textColor="black" text="请输入姓名" />
          <input id="name" text="${a}" />
          <button id="ok" text="确定2" />
          ${b}
        </vertical>`
      );
      //指定确定按钮点击时要执行的动作
      ui.ok.click(function () {
        //通过getText()获取输入的内容
        //var name = ui.name.getText();
        var name = ui.name.text();
        toast(name + "您好!");
      });


})},2000)
